package com.tedu.shoot;

import com.tedu.shoot.img.Images;

import java.awt.image.BufferedImage;

/**
 * Date：2021年08月
 * Author：程Sir
 * Content:
 *  子弹类，随英雄机位置
 */
public class Bullet extends FlyingObject {
    @Override
    public String toString() {
        return "Bullet{" +
                "speed=" + speed +
                ", wdith=" + wdith +
                ", height=" + height +
                ", x=" + x +
                ", y=" + y +
                '}';
    }

    // 速度
    public int speed; // [值表达速度大小，正负表示速度方向]

    public Bullet(){
        this.wdith = 96;
        this.height= 74;
        this.x = (int)(Math.random()*(512-this.wdith));
        this.y = -this.height;

        speed = 3;
    }



    @Override
    public BufferedImage getImage() {
        return Images.bulletImage;
    }
}
